package com.igeek.controller;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.igeek.model.insurance.Recording;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

//监听器
@Slf4j
public class ExcelListener extends AnalysisEventListener<Recording> {

    //一行一行读取excel内容，从第二行读取
    @Override
    public void invoke(Recording recording, AnalysisContext analysisContext) {
        log.info(recording.toString());
    }

    //读取表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        log.info("表头信息："+headMap.toString());
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}